package com.cby.android.sample.repository

import com.cby.android.sample.repository.api.ApiSource
import com.cby.android.sample.repository.api.MetaApiService
import com.cby.android.sample.bean.MetaImageBean
import com.cby.android.sample.bean.MetaResponseBean

/**
 * @description: MetaApi
 * @author: ChenBaoYang
 * @createDate: 2022/4/27 10:35 上午
 */
interface MetaApi {
    suspend fun loadMetaImages(
        keyword: String, page: Int, count: Int
    ): MetaResponseBean<List<MetaImageBean>>
}

class MetaApiImpl : MetaApi{
    private val apiService : MetaApiService by lazy { ApiSource.getMetaService(MetaApiService::class.java) }

    override suspend fun loadMetaImages(
        keyword: String,
        page: Int,
        count: Int
    ): MetaResponseBean<List<MetaImageBean>> {
       return apiService.loadMetaImages(keyword, page, count)
    }

}